OSPF (as described in IETF (Internet Engineering Task Force) RFC (Request for Comments) 2328, RFC 5340, and RFC 3101) is a link-state routing protocol developed for Internet Protocol (IP) networks. Link-state advertisements (LSAs) are sent to all other routers within the same hierarchical area. Areas may be combined to form an AS (Autonomous System) and routers that are connected to more than one area within an AS are called area border routers (ABR). An OSPF LSA includes information on attached interfaces, metrics used, and other variables. The routers collect and compile the LSAs from other OSPF routers to create an LSDB (Link State Database). The LSDB may describe the network topology for the whole area and is used to calculate the shortest path to other routers. Routers within the same area should have identical topological databases because they receive the same LSAs. These LSDBs are called area LSDBs. ABRs have an area LSDB for each area to which they are connected.
OSPF operations use a Shortest Path First (SPF) routing algorithm that finds for a given source vertex in the graph, the path with the shortest path between that vertex and a destination. On power-up, a router initializes its routing-protocol data structures and then waits for indications from lower-layer protocols that its interfaces are functional. The OSPF Hello protocol is then used to acquire neighbors, which are other routers that have interfaces to a common link. The router exchanges hello packets with these neighbors.
Adjacent routers have synchronized area or area level LSDBs. Some routing-protocol packets are sent and received only on adjacencies. Each router periodically sends its LSAs to provide information on its adjacencies and to provide information on its state changes. This is done by flooding. From the LSDB generated from LSAs, each router calculates a shortest-path tree (SPT) with itself as root. The SPT, in turn, yields a routing table. The SPT gives the entire path to any destination network or host, although the router typically forwards a packet to the next router in the computed shortest path.
In OSPF, before two routers can announce an adjacency to each other and use their common link for forwarding data, they exchange their databases through database description (DD) packets to assure that their area LSDBs are synchronized.
OSPF offers a few simple mechanisms to aggregate and limit the amount of topology and reachability information that routers in the OSPF routing domain are required to maintain and exchange. Within an OSPF area, all routers are required to have visibility to the link state for all of the other routers in the area. On area boundaries, reachability information within the area may be aggregated with area ranges. The aggregated reachability information is then advertised into the backbone area and re-advertised by ABRs (Area Border Routers) into other areas. Two additional types of areas are defined to limit the amount of reachability information:
A Stub Area (SA) can be configured when there is a single exit point from the area through an ABR. In a SA, no AS (Autonomous System) external routes may be advertised into the stub area and OSPF reachability information from other areas may be suppressed. The one ABR for the stub area advertises a default route that is used by all routers in the area to route all AS external traffic through the ABR.
A Not-So-Stubby-Area (NSSA) as described in IETF RFC 3101 allows external routes to be imported into the stub area LSDB but only in a limited way. In an NSSA, no AS external routes from other areas are advertised but routers within the NSSA may advertise external routes to one another. ABRs advertise a default route. OSPF inter-area reachability information from other areas may be suppressed.
Many times, and particularly in hub and spoke topologies, the remote sites or spokes get much more topology information then they need. Additionally, OSPF reliable flooding will result in a significant amount of churn. This increases traffic on the network and activity in each router without improving the routing of data traffic.